package com.demo.index;

import com.bx.weixin.service.UserService;
import com.demo.blog.BlogService;
import com.demo.common.model.User;
import com.jfinal.core.Controller;
import com.jfinal.plugin.activerecord.Page;

/**
 * 本 demo 仅表达最为粗浅的 jfinal 用法，更为有价值的实用的企业级用法
 * 详见 JFinal 俱乐部: http://jfinal.com/club
 * 
 * IndexController
 */
public class IndexController extends Controller {
	
	static BlogService service = new BlogService();
	
	static UserService userService = new UserService();
	
	public void index() {
		setAttr("blogPage", service.paginate(getParaToInt(0, 1), 30));
		setAttr("userPage", userService.paginate(getParaToInt(0, 1), 30));
		Page<User> page = userService.paginate(getParaToInt(0, 1), 30);
		render("/bx/blog.html");
	}
}





